home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / ppc-amigaos / include / clib / dos_protos.h < prev    next >
C/C++ Source or Header  |  2000-02-28  |  10KB  |  253 lines

  1. #ifndef  CLIB_DOS_PROTOS_H
  2. #define  CLIB_DOS_PROTOS_H
  3.  
  4. /*
  5. **    $VER: dos_protos.h 36.31 (17.12.92)
  6. **    Includes Release 40.15
  7. **
  8. **    C prototypes. For use with 32 bit integers only.
  9. **
  10. **    (C) Copyright 1990-1993 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. */
  13.  
  14. #ifndef  DOS_DOS_H
  15. #include <dos/dos.h>
  16. #endif
  17. #ifndef  DOS_DOSEXTENS_H
  18. #include <dos/dosextens.h>
  19. #endif
  20. #ifndef  DOS_RECORD_H
  21. #include <dos/record.h>
  22. #endif
  23. #ifndef  DOS_RDARGS_H
  24. #include <dos/rdargs.h>
  25. #endif
  26. #ifndef  DOS_DOSASL_H
  27. #include <dos/dosasl.h>
  28. #endif
  29. #ifndef  DOS_VAR_H
  30. #include <dos/var.h>
  31. #endif
  32. #ifndef  DOS_NOTIFY_H
  33. #include <dos/notify.h>
  34. #endif
  35. #ifndef  DOS_DATETIME_H
  36. #include <dos/datetime.h>
  37. #endif
  38. #ifndef  DOS_EXALL_H
  39. #include <dos/exall.h>
  40. #endif
  41. #ifndef  UTILITY_TAGITEM_H
  42. #include <utility/tagitem.h>
  43. #endif
  44.  
  45. BPTR Open( STRPTR name, long accessMode );
  46. LONG Close( BPTR file );
  47. LONG Read( BPTR file, APTR buffer, long length );
  48. LONG Write( BPTR file, APTR buffer, long length );
  49. BPTR Input( void );
  50. BPTR Output( void );
  51. LONG Seek( BPTR file, long position, long offset );
  52. LONG DeleteFile( STRPTR name );
  53. LONG Rename( STRPTR oldName, STRPTR newName );
  54. BPTR Lock( STRPTR name, long type );
  55. void UnLock( BPTR lock );
  56. BPTR DupLock( BPTR lock );
  57. LONG Examine( BPTR lock, struct FileInfoBlock *fileInfoBlock );
  58. LONG ExNext( BPTR lock, struct FileInfoBlock *fileInfoBlock );
  59. LONG Info( BPTR lock, struct InfoData *parameterBlock );
  60. BPTR CreateDir( STRPTR name );
  61. BPTR CurrentDir( BPTR lock );
  62. LONG IoErr( void );
  63. struct MsgPort *CreateProc( STRPTR name, long pri, BPTR segList,
  64.     long stackSize );
  65. void Exit( long returnCode );
  66. BPTR LoadSeg( STRPTR name );
  67. void UnLoadSeg( BPTR seglist );
  68. struct MsgPort *DeviceProc( STRPTR name );
  69. LONG SetComment( STRPTR name, STRPTR comment );
  70. LONG SetProtection( STRPTR name, long protect );
  71. struct DateStamp *DateStamp( struct DateStamp *date );
  72. void Delay( long timeout );
  73. LONG WaitForChar( BPTR file, long timeout );
  74. BPTR ParentDir( BPTR lock );
  75. LONG IsInteractive( BPTR file );
  76. LONG Execute( STRPTR string, BPTR file, BPTR file2 );
  77. /*--- functions in V36 or higher (Release 2.0) ---*/
  78. /*    DOS Object creation/deletion */
  79. APTR AllocDosObject( unsigned long type, struct TagItem *tags );
  80. APTR AllocDosObjectTagList( unsigned long type, struct TagItem *tags );
  81. APTR AllocDosObjectTags( unsigned long type, unsigned long tag1type, ... );
  82. void FreeDosObject( unsigned long type, APTR ptr );
  83. /*    Packet Level routines */
  84. LONG DoPkt( struct MsgPort *port, long action, long arg1, long arg2, long arg3,
  85.     long arg4, long arg5 );
  86. LONG DoPkt0( struct MsgPort *port, long action );
  87. LONG DoPkt1( struct MsgPort *port, long action, long arg1 );
  88. LONG DoPkt2( struct MsgPort *port, long action, long arg1, long arg2 );
  89. LONG DoPkt3( struct MsgPort *port, long action, long arg1, long arg2,
  90.     long arg3 );
  91. LONG DoPkt4( struct MsgPort *port, long action, long arg1, long arg2,
  92.     long arg3, long arg4 );
  93. void SendPkt( struct DosPacket *dp, struct MsgPort *port,
  94.     struct MsgPort *replyport );
  95. struct DosPacket *WaitPkt( void );
  96. void ReplyPkt( struct DosPacket *dp, long res1, long res2 );
  97. void AbortPkt( struct MsgPort *port, struct DosPacket *pkt );
  98. /*    Record Locking */
  99. BOOL LockRecord( BPTR fh, unsigned long offset, unsigned long length,
  100.     unsigned long mode, unsigned long timeout );
  101. BOOL LockRecords( struct RecordLock *recArray, unsigned long timeout );
  102. BOOL UnLockRecord( BPTR fh, unsigned long offset, unsigned long length );
  103. BOOL UnLockRecords( struct RecordLock *recArray );
  104. /*    Buffered File I/O */
  105. BPTR SelectInput( BPTR fh );
  106. BPTR SelectOutput( BPTR fh );
  107. LONG FGetC( BPTR fh );
  108. LONG FPutC( BPTR fh, long ch );
  109. LONG UnGetC( BPTR fh, long character );
  110. LONG FRead( BPTR fh, APTR block, unsigned long blocklen,
  111.     unsigned long number );
  112. LONG FWrite( BPTR fh, APTR block, unsigned long blocklen,
  113.     unsigned long number );
  114. STRPTR FGets( BPTR fh, STRPTR buf, unsigned long buflen );
  115. LONG FPuts( BPTR fh, STRPTR str );
  116. void VFWritef( BPTR fh, STRPTR format, LONG *argarray );
  117. void FWritef( BPTR fh, STRPTR format, ... );
  118. LONG VFPrintf( BPTR fh, STRPTR format, APTR argarray );
  119. LONG FPrintf( BPTR fh, STRPTR format, ... );
  120. LONG Flush( BPTR fh );
  121. LONG SetVBuf( BPTR fh, STRPTR buff, long type, long size );
  122. /*    DOS Object Management */
  123. BPTR DupLockFromFH( BPTR fh );
  124. BPTR OpenFromLock( BPTR lock );
  125. BPTR ParentOfFH( BPTR fh );
  126. BOOL ExamineFH( BPTR fh, struct FileInfoBlock *fib );
  127. LONG SetFileDate( STRPTR name, struct DateStamp *date );
  128. LONG NameFromLock( BPTR lock, STRPTR buffer, long len );
  129. LONG NameFromFH( BPTR fh, STRPTR buffer, long len );
  130. WORD SplitName( STRPTR name, unsigned long seperator, STRPTR buf, long oldpos,
  131.     long size );
  132. LONG SameLock( BPTR lock1, BPTR lock2 );
  133. LONG SetMode( BPTR fh, long mode );
  134. LONG ExAll( BPTR lock, struct ExAllData *buffer, long size, long data,
  135.     struct ExAllControl *control );
  136. LONG ReadLink( struct MsgPort *port, BPTR lock, STRPTR path, STRPTR buffer,
  137.     unsigned long size );
  138. LONG MakeLink( STRPTR name, long dest, long soft );
  139. LONG ChangeMode( long type, BPTR fh, long newmode );
  140. LONG SetFileSize( BPTR fh, long pos, long mode );
  141. /*    Error Handling */
  142. LONG SetIoErr( long result );
  143. BOOL Fault( long code, STRPTR header, STRPTR buffer, long len );
  144. BOOL PrintFault( long code, STRPTR header );
  145. LONG ErrorReport( long code, long type, unsigned long arg1,
  146.     struct MsgPort *device );
  147. /*    Process Management */
  148. struct CommandLineInterface *Cli( void );
  149. struct Process *CreateNewProc( struct TagItem *tags );
  150. struct Process *CreateNewProcTagList( struct TagItem *tags );
  151. struct Process *CreateNewProcTags( unsigned long tag1type, ... );
  152. LONG RunCommand( BPTR seg, long stack, STRPTR paramptr, long paramlen );
  153. struct MsgPort *GetConsoleTask( void );
  154. struct MsgPort *SetConsoleTask( struct MsgPort *task );
  155. struct MsgPort *GetFileSysTask( void );
  156. struct MsgPort *SetFileSysTask( struct MsgPort *task );
  157. STRPTR GetArgStr( void );
  158. BOOL SetArgStr( STRPTR string );
  159. struct Process *FindCliProc( unsigned long num );
  160. ULONG MaxCli( void );
  161. BOOL SetCurrentDirName( STRPTR name );
  162. BOOL GetCurrentDirName( STRPTR buf, long len );
  163. BOOL SetProgramName( STRPTR name );
  164. BOOL GetProgramName( STRPTR buf, long len );
  165. BOOL SetPrompt( STRPTR name );
  166. BOOL GetPrompt( STRPTR buf, long len );
  167. BPTR SetProgramDir( BPTR lock );
  168. BPTR GetProgramDir( void );
  169. /*    Device List Management */
  170. LONG SystemTagList( STRPTR command, struct TagItem *tags );
  171. LONG System( STRPTR command, struct TagItem *tags );
  172. LONG SystemTags( STRPTR command, unsigned long tag1type, ... );
  173. LONG AssignLock( STRPTR name, BPTR lock );
  174. BOOL AssignLate( STRPTR name, STRPTR path );
  175. BOOL AssignPath( STRPTR name, STRPTR path );
  176. BOOL AssignAdd( STRPTR name, BPTR lock );
  177. LONG RemAssignList( STRPTR name, BPTR lock );
  178. struct DevProc *GetDeviceProc( STRPTR name, struct DevProc *dp );
  179. void FreeDeviceProc( struct DevProc *dp );
  180. struct DosList *LockDosList( unsigned long flags );
  181. void UnLockDosList( unsigned long flags );
  182. struct DosList *AttemptLockDosList( unsigned long flags );
  183. BOOL RemDosEntry( struct DosList *dlist );
  184. LONG AddDosEntry( struct DosList *dlist );
  185. struct DosList *FindDosEntry( struct DosList *dlist, STRPTR name,
  186.     unsigned long flags );
  187. struct DosList *NextDosEntry( struct DosList *dlist, unsigned long flags );
  188. struct DosList *MakeDosEntry( STRPTR name, long type );
  189. void FreeDosEntry( struct DosList *dlist );
  190. BOOL IsFileSystem( STRPTR name );
  191. /*    Handler Interface */
  192. BOOL Format( STRPTR filesystem, STRPTR volumename, unsigned long dostype );
  193. LONG Relabel( STRPTR drive, STRPTR newname );
  194. LONG Inhibit( STRPTR name, long onoff );
  195. LONG AddBuffers( STRPTR name, long number );
  196. /*    Date, Time Routines */
  197. LONG CompareDates( struct DateStamp *date1, struct DateStamp *date2 );
  198. LONG DateToStr( struct DateTime *datetime );
  199. LONG StrToDate( struct DateTime *datetime );
  200. /*    Image Management */
  201. BPTR InternalLoadSeg( BPTR fh, BPTR table, LONG *funcarray, LONG *stack );
  202. BOOL InternalUnLoadSeg( BPTR seglist, void (*freefunc)() );
  203. BPTR NewLoadSeg( STRPTR file, struct TagItem *tags );
  204. BPTR NewLoadSegTagList( STRPTR file, struct TagItem *tags );
  205. BPTR NewLoadSegTags( STRPTR file, unsigned long tag1type, ... );
  206. LONG AddSegment( STRPTR name, BPTR seg, long system );
  207. struct Segment *FindSegment( STRPTR name, struct Segment *seg, long system );
  208. LONG RemSegment( struct Segment *seg );
  209. /*    Command Support */
  210. LONG CheckSignal( long mask );
  211. struct RDArgs *ReadArgs( STRPTR arg_template, LONG *array,
  212.     struct RDArgs *args );
  213. LONG FindArg( STRPTR keyword, STRPTR arg_template );
  214. LONG ReadItem( STRPTR name, long maxchars, struct CSource *cSource );
  215. LONG StrToLong( STRPTR string, LONG *value );
  216. LONG MatchFirst( STRPTR pat, struct AnchorPath *anchor );
  217. LONG MatchNext( struct AnchorPath *anchor );
  218. void MatchEnd( struct AnchorPath *anchor );
  219. LONG ParsePattern( STRPTR pat, STRPTR buf, long buflen );
  220. BOOL MatchPattern( STRPTR pat, STRPTR str );
  221. void FreeArgs( struct RDArgs *args );
  222. STRPTR FilePart( STRPTR path );
  223. STRPTR PathPart( STRPTR path );
  224. BOOL AddPart( STRPTR dirname, STRPTR filename, unsigned long size );
  225. /*    Notification */
  226. BOOL StartNotify( struct NotifyRequest *notify );
  227. void EndNotify( struct NotifyRequest *notify );
  228. /*    Environment Variable functions */
  229. BOOL SetVar( STRPTR name, STRPTR buffer, long size, long flags );
  230. LONG GetVar( STRPTR name, STRPTR buffer, long size, long flags );
  231. LONG DeleteVar( STRPTR name, unsigned long flags );
  232. struct LocalVar *FindVar( STRPTR name, unsigned long type );
  233. LONG CliInitNewcli( struct DosPacket *dp );
  234. LONG CliInitRun( struct DosPacket *dp );
  235. LONG WriteChars( STRPTR buf, unsigned long buflen );
  236. LONG PutStr( STRPTR str );
  237. LONG VPrintf( STRPTR format, APTR argarray );
  238. LONG Printf( STRPTR format, ... );
  239. /* these were unimplemented until dos 36.147 */
  240. LONG ParsePatternNoCase( STRPTR pat, STRPTR buf, long buflen );
  241. BOOL MatchPatternNoCase( STRPTR pat, STRPTR str );
  242. /* this was added for V37 dos, returned 0 before then. */
  243. BOOL SameDevice( BPTR lock1, BPTR lock2 );
  244.  
  245. /* NOTE: the following entries did NOT exist before ks 36.303 (2.02) */
  246. /* If you are going to use them, open dos.library with version 37 */
  247.  
  248. /* These calls were added for V39 dos: */
  249. void ExAllEnd( BPTR lock, struct ExAllData *buffer, long size, long data,
  250.     struct ExAllControl *control );
  251. BOOL SetOwner( STRPTR name, long owner_info );
  252. #endif     /* CLIB_DOS_PROTOS_H */
  253.